Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Objects /
Chapter 7 - View-Related Objects / View-Related Objects Reference
View Group Functions / Measuring a Shape in Global Coordinates


GXGetShapeGlobalBounds

You can use the GXGetShapeGlobalBounds function to determine the bounding rectangle of a shape in global coordinates.

boolean GXGetShapeGlobalBounds(gxShape source, 
                                 gxViewPort port,
                                 gxViewGroup group,
                                 gxRectangle *bounds);
source
A reference to the shape whose bounding rectangle you wish to determine in global coordinates.
port
A reference to a view port to which the shape is drawn.
group
A reference to the view group that defines the global coordinates.
bounds
A pointer to a rectangle structure. On return, the structure contains the bounding rectangle for the shape, in the global coordinates of the specified view group.
function result
true if the bounding rectangle appears in global space; false if it does not.
DESCRIPTION
The GXGetShapeGlobalBounds function returns a value that specifies whether the bounding rectangle of the shape drawn to the specified view port appears anywhere in the global space of the specified view group. The view port must belong to the view group, and it must be referenced in the view port list of the shape's transform object.

The GXGetShapeGlobalBounds function also returns in the bounds parameter the bounding rectangle of that part of the shape that can be drawn through the specified view port. The function returns the bounding rectangle after the shape's transform clip, mapping and style have been applied, and after all view port mappings and clips have been applied, from the view port specified in the port parameter to the root view port in the view port hierarchy (if any). The dimensions of the rectangle are in the global coordinates of the view group.

If you specify nil for the port parameter, GXGetShapeGlobalBounds includes all view ports specified in the source shape's transform's view port list. If you specify nil for the group parameter, GXGetShapeGlobalBounds includes all view groups of all specified view ports.

To determine a shape's bounding rectangle in geometry-space coordinates, use the GXGetShapeBounds function. To determine a shape's bounding rectangle in local coordinates, use the GXGetShapeLocalBounds function. To determine a shape's bounding rectangle in device coordinates, use the GXGetShapeDeviceBounds
function.

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
shape_is_nil
invalid_viewPort_reference 
invalid_viewGroup_reference
parameter_is_nil(debugging version)
Notices (debugging version) 
transform_references_disposed_viewPort 
SEE ALSO
For an example of the use of this function, see Listing 7-15 on page 7-64.

The GXGetShapeBounds function is described in the geometric operations chapter of Inside Macintosh: QuickDraw GX Graphics. The GXGetShapeLocalBounds function is described on page 7-96. The GXGetShapeDeviceBounds function is described on page 7-116.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996